package com.aaa.controller;

import com.aaa.entity.Playlist;
import com.aaa.service.TuiJianPlayListService;
import com.aaa.service.impl.TuiJianPlayListServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tuijianplaylist")
public class TuiJianPlayListController {

    @Autowired
    private TuiJianPlayListService tuiJianPlayListService;

    /**
     * 根据热度进行倒叙排列，列出前几条热度Pcolt最高的歌单
     * @param keyword
     * @return
     */
    @RequestMapping("/listDataPcolt")
    public List<Playlist> listDataPcolt(String keyword){
        return tuiJianPlayListService.listAllPcolt(keyword);
    }

    /**
     * 查询正常的，不按照热度进行排序
     * @param keyword
     * @return
     */
    @RequestMapping("/listData")
    public List<Playlist> listData(String keyword){
        return tuiJianPlayListService.listAll(keyword);
    }

}
